<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
		<title></title>
		<script type="text/javascript" src="../js/jquery-1.11.0.js"></script>
		<script type="text/javascript" src="../js/rem.js"></script>
		<script type="text/javascript" src="../js/iscroll.js"></script>
		<script type="text/javascript">
			var myscroll,pullUpEl, pullUpOffset,generatedCount = 0;
			function loaded(){
				pullUpEl = document.getElementById('pullUp');	
	            pullUpOffset = pullUpEl.offsetHeight;
				myscroll = new iScroll("wrapper",{
					scrollY:true,
					useTransition: false, /* 此属性不知用意，本人从true改为false */
					onRefresh: function () {
						if(pullUpEl.className.match('loading')) {
							pullUpEl.className = '';
							pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
						}
					},
					onScrollMove: function (){
					    if (this.y < (this.maxScrollY - 5) && !pullUpEl.className.match('flip')) {
							pullUpEl.className = 'flip';
							pullUpEl.querySelector('.pullUpLabel').innerHTML = '松手开始更新...';
							this.maxScrollY = this.maxScrollY;
						} else if (this.y > (this.maxScrollY + 5) && pullUpEl.className.match('flip')) {
							pullUpEl.className = '';
							pullUpEl.querySelector('.pullUpLabel').innerHTML = '上拉加载更多...';
							this.maxScrollY = pullUpOffset;
						}
					},
					onScrollEnd: function () {
						if (pullUpEl.className.match('flip')) {
							pullUpEl.className = 'loading';
							pullUpEl.querySelector('.pullUpLabel').innerHTML = '加载中...';				
							pullUpAction(pn);	// Execute custom function (ajax call?)
						}
					}
				});
			}
			window.addEventListener("DOMContentLoaded",loaded,false);
		</script>
		<script type="text/javascript" src="../js/fastclick.js"></script>
		<script type="text/javascript" src="../js/js.js"></script>
		<link rel="stylesheet" type="text/css" href="../css/NBA.css"/>
	</head>
	<body>
		<div class="wrap">
			<!-- 头部header -->
			<div class="header">
				<script type="text/javascript">
					$(".header").load("common-header.html");
				</script>
			</div>
	
			<!-- 球队列表 -->
			<div id="wrapper" class="balllist">
				<div class="list" id="scroller">
					
					<ul class="ullist"></ul>
					
					<!-- 上拉加载 -->
					<div id="pullUp">
						<span class="pullUpIcon"></span><span class="pullUpLabel">上拉加载更多...</span>
					</div>
					
				</div>
			</div>

		</div>
		
	</body>
</html>
